package com.burningtower.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.burningtower.entity.TbArticle;
import com.burningtower.service.ITbArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhe
 * @since 2017-11-17
 */
@RestController
@RequestMapping("/tbArticle")
public class TbArticleController {
    @Autowired
    private ITbArticleService service;
    @RequestMapping("dataGrid")
    public List<TbArticle> dataGrid(Integer page,Integer rows,String sort,String order){
        Page<TbArticle> page1=new Page(page,rows,sort);
        page1.setAsc("asc".equals(order));
        Page<TbArticle> tbArticlePage = service.selectPage(page1);
        return tbArticlePage.getRecords();
    }
}

